﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace wrsm.battlenet.entity {
    
    /// <summary>
    /// Describes the status of a Realm
    /// </summary>
    [CLSCompliant(true)]
    public class RealmStatus : BattleNetEntity, IComparable {

        /// <summary>
        /// The Status, will either be up or down
        /// </summary>
        public bool Status { get; set; }

        /// <summary>
        /// The name of the realm
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// The type of realm, pvp, normal, rp or rp-pvp
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// An indicator of the population of the realm
        /// </summary>
        public string Population { get; set; }

        /// <summary>
        /// Where the realm is located
        /// </summary>
        public string Locale { get; set; }

        /// <summary>
        /// Allows comparing RealmStatus objects
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        /// <remarks>
        /// Basically, if the status is the same, they are consdiered even,
        /// if the status has changed, then the new status being down, would indicate the new object is less than,
        /// otherwise it's creater than
        /// </remarks>
        public int CompareTo(object obj) {
            if (Status != ((RealmStatus)obj).Status) {
                return ((RealmStatus)obj).Status ? 1 : -1;
            } else {
                return 0;
            }
        }

    }
}
